﻿using System;

namespace FgoData.Core.Entity
{
    public class ServantMark
    {
        public string Name { get; set; }
        public string DetailUrl { get; set; }
        public string Rank { get; set; }    // SS, S+, S, A, B, C
        public string Score { get; set; }   // 評価
        public string Task { get; set; }    // 周回
        public string Hard { get; set; }    // 高難度
        public string Unique { get; set; }  // 唯一性

        public int AppMediaId
        {
            get
            {
                int index = DetailUrl.LastIndexOf("/", StringComparison.Ordinal);
                return Int32.Parse(DetailUrl.Substring(index+1));
            }
        }

        public double DecimalScore
        {
            get
            {
                double addition = 0;
                if (Score.Contains("+"))
                {
                    addition += 0.1;
                }
                double score = Double.Parse(Score.Replace("+", ""));
                return score + addition;
            }
        }
    }
}
